import React from 'react'
import NoMatch from '../pages/404'
import Empty from '../pages/empty'
import Bundle from '../bundle.js'
import Product from '../pages/product/index'
import Promotion from '../pages/promotion/index'
import Claim from '../pages/claim'
import Coupon from '../pages/coupon'
import CouponCreate from '../pages/coupon/create'
import CouponDetail from '../pages/coupon/detail'

import ClaimDetail from '../pages/claim/detail'
import Home from '../pages/home'

import Advertise from '../pages/advertise'
import Profile from '../pages/profile'
import Verification from '../pages/verification/index'
import ChangePassword from '../pages/user/change-password'
import ChangePasswordSuccess from '../pages/user/success'
import Order from '../pages/order'
import Financial from '../pages/financial'
import AccountManagement from '../pages/accountManagement'
const WrapComponent = (Page) => (// 按需加载
  <Bundle load={Page}>
    {(Component) => <Component />}
  </Bundle>
)

const routes = [
  { path: '/', component: Home, exact: true },
  { path: '/page-verification', component: Verification },
  { path: '/empty', component: Empty },
  { path: '/page-insurance-product', component: Home },
  { path: '/page-product', component: Product },
  { path: '/page-promotion', component: Promotion },
  { path: '/page-claim', component: Claim },
  { path: '/page-claim-detail', component: ClaimDetail },
  { path: '/page-order', component: Order },
  { path: '/page-finance', component: Financial },
  { path: '/page-profile', component: Profile },
  { path: '/page-marketing', component: Coupon },
  { path: '/page-promo-code', component: Coupon },
  { path: '/page-coupon-create', component: CouponCreate },
  { path: '/page-coupon-detail', component: CouponDetail },
  { path: '/advertise', component: Advertise },
  { path: '/page-changepassword', component: ChangePassword },
  { path: '/changepasswordsuccess', component: ChangePasswordSuccess },
  { path: '/page-account-management', component: AccountManagement },
  { component: NoMatch }
]

export default routes
